<?PHP
include_once("checklogin.php");
if(isset($_POST['dir']))
{
	if(!is_dir($_POST['dir']))
	{
		mkdir($_SESSION['dir'] . '/' . $_POST['dir'],0777,true);
	}
	if(isset($_POST['filename']))
	{
		$fp=fopen($_SESSION['dir'] . '/' . $_POST['dir'] . '/' . $_POST['filename'], 'w+');
		$content=base64_decode($_POST['content']);
		fwrite($fp,$content);
		fclose($fp);
	}
}

?>